const path = require('path');

const resolve = dir => {
    return path.join(__dirname, dir)
};
module.exports = {
    chainWebpack: config => {
        config.resolve.alias
            .set('@', resolve('src')) // key,value自行定义，比如.set('@@', resolve('src/components'))
            .set('excel', resolve('src/excel'))
    },
    baseUrl: '/',
    outputDir: 'dist',

    devServer: {
        open: true,
        //处理异步请求
        proxy: {
            '/api': {
                target: 'http://longzongqin.cn/api',
                ws: true,
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                },
            }
        }
    },

    lintOnSave: false
};
